<#include "header.htm"/>

		 <table style="margin-top:10px;"  cellspacing="0" cellpadding="1" width="100%" align="center" border="0">
				<tr>
					<td valign="bottom" align="left">
					<#if logged>
					    <span class="gensmall">${I18n.getMessage("ForumListing.lastVisit")}: ${lastVisit}</span><br />
					</#if>
						<span class="gensmall">${I18n.getMessage("ForumListing.date")}: ${now}</span><br />
						<span class="forumlink"><a class="forumlink" href="${JForumContext.encodeURL("/forums/list")}">${I18n.getMessage("ForumListing.forumIndex")}</a></span>
					</td>
					<td class="gensmall" valign="bottom" align="right">&nbsp;
					<#if logged>
						<a class="gensmall" href="${JForumContext.encodeURL("/forums/newMessages")}">${I18n.getMessage("ForumListing.readLastVisitMessages")}</a>
					</#if>
					</td>
				</tr>
			</table>
			
			<table class="forumline"   cellspacing="1" cellpadding="0" width="100%" border="0">
				<tr>
					<th class="thcornerl"   align="center" width="30" >${I18n.getMessage("ForumBase.state")}</th>
					<th class="thtop" nowrap="nowrap"     align="center"  >&nbsp;${I18n.getMessage("ForumListing.forums")}&nbsp;</th>
					<th class="thtop"    nowrap="nowrap" align="center" width="200">&nbsp;${I18n.getMessage("ForumIndex.forumAdmins")}&nbsp;</th>
					<th class="thtop" nowrap="nowrap" align="center" width="80">&nbsp;${I18n.getMessage("ForumListing.totalTopics")}&nbsp;</th>
					<th class="thcornerr" nowrap="nowrap" align="center" width="80">&nbsp;${I18n.getMessage("ForumListing.totalMessages")}&nbsp;</th>
				</tr>
 
		         <tr>
		          	  <td   class="row3left" height="60" align="center" valign="middle" width="30"><img src="${contextPath}/templates/${templateName}/images/folder_new_big.gif" alt="[New Folder]" /></td>
		          
		              <td   class="row3left"      onmouseover="style.backgroundColor='#FFFFFF'" onmouseout="style.backgroundColor='#EFEFEF'">
		              <span class="forumlink" ><a id="allTopic"    style="color:#000000;font-size:15px;" href="${JForumContext.encodeURL("/allTopics/list")}" >${I18n.getMessage("ForumBase.allForum")}</a></span>&nbsp;
		              	<#assign newcount = summaryRepository.getAllNewTopicCountToday() />
							<#if (newcount>0) >
							<span class="genmed">
                             (今日:
							<span style="color:red;font-size:15px;">
							 ${newcount}
							</span>
							)
							</span>
						</#if>
						<br />
						<span class="genmed">
							----所有的帖子的集合
						</span>
		              </td>
		              <td   class="forumlistRow" valign="middle" align="center"   nowrap="nowrap"  >&nbsp;&nbsp;</td>
		              <td  class="forumlistRow" valign="middle" align="center"   nowrap="nowrap"  >&nbsp;<span class="gensmall">${totalTopics}</span>&nbsp;</td>
		              <td class="forumlistRow" valign="middle" align="center"   nowrap="nowrap"  >&nbsp;<span class="gensmall">${totalMessages}</span>&nbsp;</td>
		          </tr>
				<!-- START FORUM LISTING -->
				<#list allCategories as category>
					<tr >
						<td class="catleft"   colspan="5" align="left"  ><span class="cattitle" style="color:#ffffff;">${category.name}</span>&nbsp;</td>
					</tr>

					<#list category.getForums() as forum>
					<tr>
                        <td class="row3left" valign="middle" align="center" height="45" valign="middle" width="30">
						<#if forum.unread>
							<img src="${contextPath}/templates/${templateName}/images/folder_new_big.gif" alt="[New Folder]" />
						<#else>
							<img src="${contextPath}/templates/${templateName}/images/folder_big.gif" alt="[Folder]" />
						</#if>
						</td>
						<td  class="row3left" valign="middle"   onmouseover="style.backgroundColor='#FFFFFF'" onmouseout="style.backgroundColor='#EFEFEF'" >
							<span > <a class="forumlink"  style="color:#000000;font-size:15px;" href="${JForumContext.encodeURL("/forums/show/${forum.id}")}">
							 ${forum.name?default("")} 		 
							</a> </span>&nbsp;
							
							<#assign newTopiccount = summaryRepository.getCountTodayByForumId(forum.id) />
							<#if (newTopiccount>0) >
							 <span class="genmed">
                             (今日:
							<span style="color:red;font-size:15px;">
							 ${newTopiccount}
							</span>
							 )
							</span>
							</#if>
								
							<#if forum.description?exists>
							<br />
							<span class="genmed">
							${forum.description?default("")}
							</span>
							</#if>				
						</td>
						 
						<td   class="forumlistRow" valign="middle" align="center"  nowrap="nowrap"    >
						     <span class="gensmall">
						     <#assign moderators = forumRepository.getModeratorList(forum.id)/>
								<#list moderators as m>
								  <#assign users=moderatorRepository.getModeratorsByGroup(m.id)/>
								  <#list users as u>
								  <a href="${JForumContext.encodeURL("/user/profile/${u.id}")}">${u.username?html}</a>  &nbsp;&nbsp;
								  </#list>
								 </#list>
                             </span>&nbsp;
						</td>
						<td  class="forumlistRow" valign="middle" align="center" nowrap="nowrap"   >
						   <span class="gensmall">${forum.totalTopics}</span>&nbsp;
						</td>
						<td class="forumlistRow" valign="middle" align="center"   nowrap="nowrap"   >
							<#assign total = forum.totalPosts/>
							<#if (total == 0 && forum.totalTopics > 0)>
								<#assign total = forum.totalTopics/>
							</#if>
							<span class="gensmall">
							<#if (total > 0)>
							${total}<#else>${I18n.getMessage("ForumListing.noMessages")}</span>&nbsp;
						    </#if>
						</td>
 					
					</tr>
					</#list>
				</#list>		
				<!-- END OF FORUM LISTING -->
			</table>
			
			<#if session?exists && session.isAdmin()>
			<br />
					<table cellspacing="1" cellpadding="3" width="100%" border="0">
            <tr>
				<td  align="center" width="100%" class="gensmall">
				共 ${totalMessages}篇文章,注册会员数:${totalRegisteredUsers},在线总人数:${totalOnlineUsers},在线会员数:${totalRegisteredOnlineUsers},未登录访客数:${totalAnonymousUsers},最高在线用户数:${mostUsersEverOnline.getTotal()}
				</td>
		   </tr>
	    </table>
			</#if>
			
			</br>
<#include "bottom.htm"/>
